import request from '@/utils/request'

// 新增或修改广告信息
export const saveOrUpdate = data => {
  return request({
    method: 'POST',
    url: '/front/ad/saveOrUpdate',
    data
  })
}

// 获取所有广告列表
export const getAdList = data => {
  return request({
    method: 'GET',
    url: '/front/ad/getAdList',
    data
  })
}

// 更新广告状态接口
export const updateStatus = params => {
  return request({
    method: 'GET',
    url: '/front/ad/updateStatus',
    params
  })
}

// 根据id获得广告接口
export const getAdById = id => {
  return request({
    method: 'GET',
    url: `/front/ad/getAdById?id=${id}`,
    id
  })
}
